package ObjectOrientedTest1;

public class GameTest {
    public static void main(String[] args) {
        Role p1=new Role("A",100);
        Role p2=new Role("B",100);
        while (true){
            //A打B
            p1.attack(p2);
            if(p2.getBlood()==0){
                System.out.println(p1.getName()+"打赢了"+p2.getName());
                break;
            }
            //B打A
            p2.attack(p1);
            if(p1.getBlood()==0){
                System.out.println(p2.getName()+"打赢了"+p1.getName());
                break;
            }
        }
    }
}
